package com.aboo.action.frame;

import com.aboo.action.BaseAction;
import com.aboo.po.frame.ResultPO;
import com.aboo.service.frame.IResultService;
import com.aboo.util.StringUtils;

public class EditResultAction extends BaseAction {

	private static final long serialVersionUID = 418862079335690824L;
	private IResultService resultService;
	
	private String resultCode;
	private String resultInfo;

	public String execute() throws Exception {
		if (!StringUtils.isBlank(this.resultCode) && !StringUtils.isBlank(this.resultInfo)) {
			this.setContent("Success!");
			
			ResultPO result = new ResultPO();
			result.setResultCode(resultCode);
			result.setResultInfo(resultInfo);
			resultService.save(result);
			
			return SUCCESS;
		} else {
			this.setContent("ResultCode 或 ResultInfo 为空！");
		}
		
		return ERROR;
	}

	public String getResultCode() {
		return resultCode;
	}

	public void setResultCode(String resultCode) {
		this.resultCode = resultCode;
	}

	public String getResultInfo() {
		return resultInfo;
	}

	public void setResultInfo(String resultInfo) {
		this.resultInfo = resultInfo;
	}

	public IResultService getResultService() {
		return resultService;
	}

	public void setResultService(IResultService resultService) {
		this.resultService = resultService;
	}

}
